//
//  ASJGameStageLayer.m
//  ASJ001
//
//  Created by zephyrhan on 11/13/11.
//  Copyright (c) 2011 Ebrothers tech. All rights reserved.
//

#import "ASJGameStageLayer.h"
#import "ASJGlobalDefine.h"
#import "ASJSkill.h"
#import "ASJActor.h"
#import "ASJMonster.h"

@implementation ASJGameStageLayer


- (id)initWithStage:(ASJStage*)s {
    assert(s != nil);
    
	if((self = [super init])) {
        stage = [s retain];
        [stage setupStageInLayer:self];
        
        [stage start];
        [self scheduleUpdate];
	}
    
	return self;
}


- (void)update:(ccTime)dt {
    [stage backgroundMove];
    [stage gameStep];
}


- (void)gameOver {
    [self unscheduleUpdate];
    [stage stop];
    [[CCDirector sharedDirector] pause];
}

@end
